package com.gdsunfly.mongodb.configure;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.mongodb.MongoDbFactory;
import org.springframework.data.mongodb.MongoTransactionManager;


/**
 * mongodb 配置
 * @author gdsunfly_wangquanqing
 * @date 2019/6/13 9:46
 */
@Configuration
public class MongoConfig{

    /**
     * 事务管理
     * @param dbFactory
     * @return
     */
    @Bean
    MongoTransactionManager transactionManager(MongoDbFactory dbFactory) {
        return new MongoTransactionManager(dbFactory);
    }

}
